/*************************************************************
 * Title: 
 * Description: 
 * Author: Snow Huang
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com
 * CreateTime: Aug 20, 2010 2:20:45 PM
 * Copyright © 落羽社区 All right reserved
 ************************************************************/
package snow.core.domain.dao;

import java.io.Serializable;
import java.util.List;

import org.springframework.jdbc.core.support.JdbcDaoSupport;

/**
 * 
 */
public abstract class BaseDao<Entity, Identity extends Serializable> extends JdbcDaoSupport {

	protected abstract void delete(final Entity entity);

	protected final void execute(final String sql) {
		getJdbcTemplate().execute(sql);
	}

	protected abstract Entity get(final Identity identity);

	protected abstract Entity load(final Identity identity);

	protected abstract List<Entity> loadAll();

	protected abstract Identity save(final Entity entity);

	protected abstract void saveOrUpdate(final Entity entity);

	protected abstract void update(final Entity entity);

}
